package com.bqtt.tumor.demo.entity;

import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.bqtt.tumor.demo.common.utility.InlineTools;


@Entity
@Table(name="medicine_def") 
public class Medicine  implements IDBEntity{

	@Id 
    @Column(name="medicine_id")    
    @GeneratedValue(strategy=GenerationType.IDENTITY) 
	private int medicine_id;
	
	@Column(name="name", length= 255)   
	private String name;
	
	@Column(name="english_name", length= 255)   
	private String english_name;
	
	@Column(name="serial_no", length= 255)   
	private String serial_no;
	
	@Column(name="produce_country", length= 255)   
	private String produce_country;
	

	@Column(name="price")  
	private double price;
	
	@Column(name="illustration", length= 1000)   
	private String illustration;

	@Transient
	private String displayName;
	
	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}
	
	
	
	public Medicine() {
		super();
		displayName="none";
		// TODO Auto-generated constructor stub
	}

	@Override
	public Map<String, Object> getSQLValidAttributes() {
		// TODO Auto-generated method stub
		
		Map<String,Object> result = new HashMap<String,Object>();
		
		if(!InlineTools.isEmpty(name))
		{
			result.put("name", name);
		}
		return result;
	}

	@Override
	public void fillStringField() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void fillDBfields() {
		// TODO Auto-generated method stub
		
	}

	public int getMedicine_id() {
		return medicine_id;
	}

	public void setMedicine_id(int medicine_id) {
		this.medicine_id = medicine_id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getEnglish_name() {
		return english_name;
	}

	public void setEnglish_name(String english_name) {
		this.english_name = english_name;
	}

	public String getSerial_no() {
		return serial_no;
	}

	public void setSerial_no(String serial_no) {
		this.serial_no = serial_no;
	}

	public String getProduce_country() {
		return produce_country;
	}

	public void setProduce_country(String produce_country) {
		this.produce_country = produce_country;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public String getIllustration() {
		return illustration;
	}

	public void setIllustration(String illustration) {
		this.illustration = illustration;
	}

	
}
